//============================================================================
// Name        : SHA1Impl.cpp
// Author      : HuYao
// Version     :
// Copyright   : Rights All Reserved
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include "header/SHA1.h"
#include <string.h>

using namespace std;

int main() {
	//cout << "Hello World" << endl; // prints Hello World
    char msg[] = "The quick brown fox jumps over the lazy dog";
	SHA1 sig;
	sig.update((unsigned char*)msg, (unsigned long) (sizeof(msg) / sizeof(msg[0])));
	sig.dofinal();
	unsigned char* dig = sig.getDigest();
	unsigned char  digCopy[20];
	memset(digCopy,0,20);
	memcpy(digCopy,dig,20);
	for (int i = 0; i < 20; ++i) {
		printf("%02X", digCopy[i]);
	}
	return 0;
}

